package com.djhu.newscollector.crawel.imp.worker;

import com.djhu.newscollector.core.entity.Response;
import com.djhu.newscollector.crawel.net.Page;

/**
 * Created by zw on 2018/2/12.
 */
public class NewsResponse implements Response{
    private Page page;
    private Exception exception;
    @Override
    public String id() {
        return page.getRequest().getUrl().getUrl();
    }

    @Override
    public Exception exception() {
        return exception;
    }

    @Override
    public boolean success() {
        return exception == null;
    }

    public Page getPage() {
        return page;
    }

    public void setPage(Page page) {
        this.page = page;
    }

    public Exception getException() {
        return exception;
    }

    public void setException(Exception exception) {
        this.exception = exception;
    }
}